<?php
/**
 * Created by PhpStorm.
 * User: 王松
 * Time: 2017/6/25 13:33
 */

namespace App\Transformers;

use App\Models\MedicalHpiSub;
use League\Fractal\TransformerAbstract;

class HpiSubTransformer extends TransformerAbstract
{
    public function transform(MedicalHpiSub $hpi)
    {
        return [
            'id'               => $hpi->id,
            'record_id'        => $hpi->record_id,
            'started_at'       => $hpi->started_at,
            'inducement'       => $hpi->inducement,
            'symptoms'         => $hpi->symptoms,
            'clinic_site'      => $hpi->clinic_site,
            'diagnose'         => $hpi->diagnose,
            'medication'       => $hpi->medication,
            'before_treatment' => $hpi->before_treatment,
            'after_treatment'  => $hpi->after_treatment,
            'cn_medication'    => $hpi->cn_medication,
            'created_at'       => $hpi->created_at->toDateTimeString(),
            'updated_at'       => $hpi->updated_at->toDateTimeString(),
        ];
    }
}